package com.lst.api.utils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import org.apache.commons.lang3.StringUtils;

import java.util.Collections;
import java.util.List;

/**
 * @author: Frank
 * @date: 2019/10/12 14:09
 * @version: V1.0
 */
public class PicUrlUtils {

    /**
     * 解析字符串变成对象
     *
     * @param priUrls
     * @return
     */
    public static final List<String> parsePicUrls(String priUrls) {
        if (StringUtils.isBlank(priUrls)) {
            return Collections.EMPTY_LIST;
        }
        try {
            List<String> response = JSON.parseObject(priUrls, new TypeReference<List<String>>() {
            });
            return response;
        } catch (Exception e) {
            return Collections.EMPTY_LIST;
        }
    }
}
